feat(spinner): port pf-v5-spinner to pf-v6-spinner element#3137
feat(spinner): port pf-v5-spinner to pf-v6-spinner element#3137zeroedin wants to merge 13 commits into
Conversation
Port pf-v5-spinner to pf-v6-spinner with v6 design tokens and API: - Migrate CSS tokens from --pf-v5-* to --pf-v6-* namespace - Update icon size tokens to --pf-t--global--icon--size--* (v6) - Add `xs` size variant (new in v6) - Add `inline` boolean attribute for font-size-inherited spinners - Add `accessible-label` attribute (abstracts aria-label via internals) - Set role=progressbar and aria-valuetext via InternalsController - Export `SpinnerSize` type union - Avoid sprouting default `size` attribute (CSS handles xl default) - Add demos: basic, size-variations, custom-size, inline-size - Add unit tests with a11ySnapshot assertions and size measurements - Update elements/package.json exports Closes #3037 Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove unused styleMap import - Use `static styles = [styles]` array form convention - Move diameter CSS custom property to willUpdate (host style) - Sync ariaValueText with accessibleLabel changes - Simplify render return type to TemplateResult - Use individual rotate property instead of transform function - Add prefers-reduced-motion media query - Add cem generate output path to config Assisted-By: Claude Opus 4.6 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 456b40e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Commitlint tests passed!More Info{
"valid": true,
"errors": [],
"warnings": [],
"input": "feat(spinner): port pf-v5-spinner to pf-v6-spinner element"
} |
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
bennypowers
left a comment
There was a problem hiding this comment.
The issue in question is an "update" issue, not a "create" issue:
- commit message must be
feat(spinner)!: port to pf-v6-spinner - delete elements/pf-v5-spinner
| if (changed.has('accessibleLabel')) { | ||
| const label = this.accessibleLabel ?? 'Loading...'; | ||
| this.#internals.ariaLabel = label; | ||
| this.#internals.ariaValueText = label; |
There was a problem hiding this comment.
this should be a separate public property
cc @adamjohnson
bennypowers
left a comment
There was a problem hiding this comment.
should remove all existing pf-v5-spinner references
|
Tests are failing here because pf-v5-button imports pf-v5-spinner, and pf-v5-alert uses pf-v5-button internally. The chain is pf-v5-alert → pf-v5-button → pf-v5-spinner (which this PR deleted). Should we update pf-v5-button to point at pf-v6-spinner or just move on? |
Summary
<pf-v5-spinner><pf-v5-spinner>to<pf-v6-spinner>web component for PatternFly v6role="progressbar"via ElementInternalssize(xs/sm/md/lg/xl),inline,diameter, andaccessible-labelattributesprefers-reduced-motionsupportCloses #3037
Depends on #3130
Intentional divergences from React
xssize supported (exists in PF core SCSS but not React's enum)sizedefaults toundefined(CSS fallback achieves xl visual default without sprouting attribute)accessible-labelabstractsariaLabel/ariaValueTextper ADVICE.mdrotateproperty instead oftransform: rotate()prefers-reduced-motionhandled via media query (React uses.pf-m-no-motionclass)Test plan
npm run testpasseslocalhost:8000with?rendering=chromelessprogressbarrole with correct labelprefers-reduced-motion: reduceAssisted-By: Claude noreply@anthropic.com